/*
类模板申明与实现放到一起 并把文件后缀改成 hpp
*/

#include <iostream>
using namespace std;

template<class KindType, class NameType>
class Animal
{
    public:
    KindType m_kind;
    NameType m_name;

    // 成员函数类内申明
    Animal(KindType kind, NameType name);
    void show();
};

// 构造函数类外实现
template<class T1, class T2>
Animal<T1, T2>::Animal(T1 kind, T2 name){
    m_kind = kind;
    m_name = name;
}

// 成员函数类外实现
template<class T1, class T2>
void Animal<T1, T2>::show()
{
    cout << "kind: " << m_kind << " name: " << m_name << endl;
}